<template>
  <div>text2</div>
</template>
 <script setup>
import { createWorker } from "tesseract.js";

(async () => {
  const worker = await createWorker("chi_sim", 2, {
    workerPath:
      "https://cdn.jsdelivr.net/npm/tesseract.js@v5.0.0/dist/worker.min.js",
    langPath: "https://tessdata.projectnaptha.com/4.0.0",
    corePath: "https://cdn.jsdelivr.net/npm/tesseract.js-core@v5.0.0",
  });
  // await worker.load();
  // await worker.loadLanguage("chi_sim");
  // await worker.initialize("chi_sim");

  const ret = await worker.recognize(
    "https://image2.sina.com.cn/dy/c/2004-06-02/1086134941_guaG6q.jpg"
  );

  // const ret = await worker.recognize("./aa.png");
  console.log("对对对", ret.data.text);
  await worker.terminate();
})();
</script>
            
